1. Field of the Invention
The present invention relates to a phase difference detection method, a phase difference detection apparatus, a range finding apparatus and an imaging apparatus.
2. Description of the Related Art
In a conventional automatic focusing camera and the like, when focusing on an object to be photographed by use of a so-called passive system, in case of a non-TTL camera, the distance to the object is detected by use of an image of the object which does not pass through a taking lens. Thereafter, a position of the taking lens is controlled in response to the detected distance to the object. In the case of a TTL camera, a shift amount from a focused state is detected by use of an image of the object obtained through the taking lens. Thereafter, the rotational position of the taking lens is controlled in response to the detected shift amount. The principle of the above-described series of operations will be described below with reference to FIG. 3A.
As shown, a pair of lenses 1a and 1b are disposed apart from each other by a predetermined base line length b, and images of an object 2 are respectively formed through optical paths A and B which are different from each other on a pair of optical sensor arrays 3a and 3b which are disposed apart from the pair of lenses 1a and 1b by a focal distance f. It is assumed that the object 2 is located at a position in front of the pair of lenses 1a and 1b by a distance L.
When the object 2 is located at a distance L of infinity, centers of the images formed on the pair of optical sensor arrays 3a and 3b are formed at reference positions (3a1, 3b1) on the optical sensor arrays 3a and 3b which correspond to optical axes of the lenses 1a and 1b. However, when the object 2 is closer than a distance of infinity, the images are formed at positions which are shifted by an amount (from reference positions 3a1, 3b1). Based on the principle of triangular ranging, the distance L to the object 2 equals bf/xcex1. Here, since the base line length b and the focal distance f are constants, if the shift amount xcex1 is detected, the distance L can be calculated. This is the principle of passive ranging (so-called outside light triangular ranging), which is used in the non-TTL camera. In the non-TTL camera, the shift amount a may be used as it is for calculation purposes instead of using the distance L as an output value of a range finding apparatus.
In case of the TTL camera, by applying a light passed through an imaging lens (not shown) to the pair of lenses 1a and 1b in the same manner as described above, the shift amount xcex1 between a pair of left and right images is detected. In this case, it is assumed that centers of images in case of a focused state are reference positions on the respective optical sensor arrays 3a and 3b. Thus, positive and negative values of the shift amount xcex1 indicate a front focus state and a rear focus state, respectively, and the absolute values thereof indicate an extent of the shift from in-focus. In addition, in the present specification, the shift amount axcex1 is referred to as a phase difference.
In any of the cameras described above, the image of an object to be photographed is formed on the pair of optical sensor arrays by an optical system, and a relative shift of the pair of image signals output by the pair of optical sensor arrays, i.e., the phase difference, is detected by carrying out a process known as correlation calculation about partial image data groups (see FIG. 3B) extracted from the pair of image signals, respectively. In addition, phase difference detection as described above is not limited to automatic focusing cameras but can be used for various range finding apparatuses, focal point detection apparatuses, and the like, which measure the distance to an object or focus on an object.
In an apparatus which uses phase difference detection as a method for reducing degradation of detection accuracy due to the presence of a back-light from strong light sources such as the sun, which serve as a background of an object to be photographed (at a time of so-called back-light), there is one such device which is described, for example, in Japanese Patent No. 3,230,759 (JP-A-5-264892). More specifically, it is judged whether or not there is an effect of a flare light acting as a back-light on the output of an optical sensor. When it is judged that there is an effect of a flare light, a compensation value based upon a difference in light intensities of the pair of the image signals and, more particularly, based on a difference in average values of respective image signals, is calculated. The calculated compensation value is added to or subtracted from one of the image signals. The phase difference is then calculated by carrying out the correlation calculation based upon the image signal after performing such compensation.
However, the effect caused by a back-light is fairly complicated, and even if a predetermined compensation routine is carried out to correct the image signal as described above, the effect of the back-light is not necessarily removed. For example, when the pair of image signals take on the states shown in FIGS. 4A and 4B due to the presence of a back-light, even if the compensation value is determined based upon the difference in light intensities of the pair of image signals in the manner described above and compensation is performed by adding or subtracting the calculated compensation value to or from one of the image signals, it becomes difficult to remove the effect of the back-light from the image signal. Accordingly, in the technology described in the above U.S. Pat. No. 3,230,759 (JP-A-5-264892), there is a possibility that a non-productive compensation is carried out.
An object of the present invention is to provide a phase difference detection method, a phase difference detection apparatus, a ranging (or range finding) apparatus, and a imaging apparatus which can reduce the possibility of non-productive compensation.
A phase difference detection method in accordance with a first aspect of the present invention comprises a judgment step of judging whether or not a predetermined compensation would be effective on an image data row which is generated in response to outputs of a pair of optical sensor arrays on which images of a measurement image object are formed, a first phase difference detection step of detecting a phase difference between the images formed on the pair of sensor arrays based upon the image data row when it is judged that the predetermined compensation would not be effective, and a second phase difference detection step of carrying out the predetermined compensation with respect to the image data row when it is judged that the predetermined compensation would be effective and of detecting a phase difference between the images formed on the pair of sensor arrays based upon the image data row after performing the predetermined compensation.
By the foregoing method, when it is judged that the predetermined compensation would not be effective based upon the image data row, the phase difference between the images formed on the pair of sensor arrays is detected, and when it is judged that the predetermined compensation would be effective, the predetermined compensation is applied to the image data row and, based upon the compensated image data, the phase difference of the images formed on the pair of sensor arrays is detected. Thus, it becomes possible to reduce the occurrence of unproductive compensation.
In accordance with a second aspect of the present invention, the predetermined compensation is deemed effective when, based upon the image data row, an output waveform of one of the pair of optical sensor arrays is shifted in parallel with respect to an output waveform of one the other optical sensor array, and the compensation is based upon the amount of the shift. Accordingly, in addition to the above-described advantage, effective compensation can be carried out when the output waveform of one of the pair of optical sensor arrays is shifted in parallel to the output waveform of the other optical sensor array.
In accordance with a third aspect of the present invention, the image data row is a pair of image data rows each comprising a plurality of image data values which are generated in response to outputs of the pair of optical sensor arrays on which the images of the measurement image object are formed, the judgment step is performed to judge whether the predetermined compensation would be effective when a difference between a difference in maximum value image data in each of the pair of image data rows and a difference in minimum value image data in each of the pair of image data rows falls within a predetermined range, and compensation is performed to compensate the image data rows by a compensation value determined based upon the difference in the maximum value image data and the difference in the minimum value image data.
By the foregoing method, it is possible to reduce the possibility of non-productive compensation. In addition, since the difference in the maximum value image data and the difference in the minimum value image data are used for judging whether or not the difference falls within the predetermined range and also for calculating the compensation value, it becomes possible to achieve dual uses of the same data.
In accordance with a fourth aspect of the present invention, a phase difference detection apparatus is provided, which comprises a judgment unit for judging whether or not a predetermined compensation would be effective to compensate an image data row which is generated in response to outputs of a pair of optical sensor arrays on which images of a measurement image object are formed, a first phase difference detection unit for detecting a phase difference between the images formed on the pair of sensor arrays based upon the image data row when it is judged by the judgment unit that the predetermined compensation would not be effective, and a second phase difference detection unit for carrying out the predetermined compensation with respect to the image data row when it is judged by the judgment unit that the predetermined compensation would be effective and detecting a phase difference between the images formed on the pair of sensor arrays based upon the image data row after performing the compensation.
By the foregoing structure, when it is judged that the predetermined compensation would not be effective based upon the image data row, the phase difference between the images formed on the pair of sensor arrays is detected without performing compensation. On the other hand, when the predetermined compensation is deemed to be effective, the predetermined compensation is applied to the image data row. Based upon the image data obtained after performing the compensation, the phase difference between the images formed on the pair of sensor arrays is detected, and it becomes possible to reduce the possibility of performing unproductive compensation.
In accordance with a fifth aspect of the present invention, the judgment unit judges that the predetermined compensation is effective when, based upon the image data row, an output waveform of one of the pair of optical sensor arrays is shifted in parallel with respect to an output waveform of the other optical sensor array, and the compensation is based upon the amount of such shift. In addition to the above-described advantage, this enables effective compensation to be carried out when the output waveform of one of the pair of optical sensor arrays is shifted in parallel relative to the output waveform of the other optical sensor array.
In accordance with a sixth aspect of the present invention, the image data row of the foregoing aspect is a pair of image data rows each comprising a plurality of image data units which are generated in response to outputs of the pair of optical sensor arrays on which the images of the measurement image object are formed, the judgment unit judges that the predetermined compensation would be effective when a difference between a difference in maximum value image data in each of the pair of image data rows and a difference in minimum value image data in each of the pair of image data rows falls within a predetermined range, and compensation is performed to compensate the image data rows by a compensation value based upon the difference of the maximum value image data and the difference of the minimum value image data. Accordingly, in addition to the above-described advantages, since the difference in the maximum value image data and the difference in the minimum value image data are used when judging whether or not the difference falls within the predetermined range and calculating the compensation value, it becomes possible to achieve dual uses of the same data.
In accordance with a seventh aspect of the present invention, any one of the fourth through sixth aspects is further provided with a second judgment unit for judging whether or not there is an effect of a back-light on the images formed on the pair of sensor arrays based upon the image data row, and a third phase difference detection unit for detecting a phase difference between the images formed on the pair of sensor arrays based upon the image data row when the second judgment unit judges that there is no effect of back-light, wherein the judgment unit carries out the judgment when the second judgment unit judges that there is an effect caused by the back-light. In addition to the above-described advantages, since, in case that it is judged that there is no effect of back-light, the phase difference detection is carried out without judging whether or not the predetermined compensation is effective, this judgment can be eliminated when there is no need for carrying out the judgment of whether or not the predetermined compensation is effective.
In accordance with an eighth aspect of the present invention, a range finding apparatus comprises the above-described phase difference detection apparatus, and a distance detection unit for calculating a distance to a target based upon a phase difference detected by the phase difference detection apparatus. By such a structure, in addition to the above-described advantages, it becomes possible to reduce the possibility of non-productive compensation when calculating the distance data.
In accordance with a ninth aspect of the present invention, an imaging apparatus comprises the above-described phase difference detection apparatus, an objective lens, an image formation unit on which an image of the target passed through the objective lens is formed, and a focusing control unit for carrying out a focusing operation between the objective lens and the image formation unit in response to the phase difference calculated by the phase difference detection apparatus. By such structure, it becomes possible to reduce the possibility of non-productive compensation when carrying out the focusing operation.